package com.xy.dp.command;

public class Control {
    private Command commandOn;
    private Command commandOff;

    public Control(Command commandOn,Command commandOff) {
        this.commandOff = commandOff;
        this.commandOn = commandOn;
    }

    public void turnOn() {
        commandOn.execute();
    }

    public void turnOff() {
        commandOff.execute();
    }
}
